<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
	<head>
		<base href="<%=basePath%>">

		<title>文章上传与编辑管理</title>
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>jslib/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>css/theme.css">
		<link rel="stylesheet"
			href="<%=basePath%>jslib/font-awesome/css/font-awesome.css">
		<script src="<%=basePath%>jslib/jquery-1.7.2.min.js"
			type="text/javascript"></script>

	</head>

	<body class="content1">
		<div class="header">
			<h1 class="page-title">
				文章上传与编辑管理
			</h1>
		</div>
		<ul class="breadcrumb">
			<li>
				<a href="sys/welcome.html">Home</a>
				<span class="divider">/</span>
			</li>
			<li class="active">
				文章列表
			</li>
		</ul>
		<div class="container-fluid">
			<div class="row-fluid">
				<form class="form-inline" method="post"
					action="<%=basePath%>sys/article/article?cmd=listForUploaderAndAdmin">
					<input class="input-xlarge" placeholder="您想搜索的关键字..." name="keyword"
						type="text">
					<input class="btn icon-search" type="submit" value="查询" />
					<a class="btn btn-primary"
						href="<%=basePath%>sys/article/article?cmd=toupload"> 
						<i class="icon-plus"></i> 
						上传文章 
					</a>
				</form>

				<div class="well">
					<table class="table">
						<thead>
							<tr>
								<th>
									文章标题
								</th>
								<th>
									文章主题
								</th>
								<th>
									责任编辑
								</th>
								<th>
									文章来源
								</th>
								<th>
									审核情况
								</th>
								<th>
									发布情况
								</th>
								<th style="width: 90px;">
									操作
								</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${pager.list}" var="item">
								<tr>
									<td>
										${item.title}
									</td>
									<td>
										${item.theme}
									</td>
									<td>
										${item.editor}
									</td>
									<td>
										${item.source}
									</td>
									<td>
										<c:if test="${item.ischecked == 1}">已通过</c:if>				
										<c:if test="${item.ischecked == -1}">未通过</c:if>		
										<c:if test="${item.ischecked == 0}">未审核</c:if>
									</td>
									
									<td>
										<c:if test="${item.ispublish == 1}">已发布</c:if>				
										<c:if test="${item.ispublish == -1}">不发布</c:if>		
										<c:if test="${item.ispublish == 0}">未查看</c:if>
									</td>
									<td>
										<a href="<%=basePath%>sys/article/article?cmd=toedit&id=${item.articleid}">编辑</a>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<div class="pagination pagination-right">
						<ul>
							<li>
								<a>共计：${pager.pagectrl.pagecount}页/${pager.pagectrl.rscount}条记录</a>
							</li>

							<li>
								<c:if test="${pager.pagectrl.currentindex==1}" var="fp">
									<a style="disabled: true">上一页</a>
								</c:if>
								<c:if test="${!fp}">
									<a
										href="<%=basePath%>sys/article/article?cmd=listForUploaderAndAdmin&index=${pager.pagectrl.currentindex-1}">上一页</a>
								</c:if>
							</li>

							<c:forEach begin="${pager.pagectrl.minpage}" step="1"
								end="${pager.pagectrl.maxpage}" var="index">
								<li>
									<c:if test="${pager.pagectrl.currentindex==index}" var="t">
										<a style="color: red; background-color: #bbb">${index}</a>
									</c:if>
									<c:if test="${!t}">
										<a href="<%=basePath%>sys/article/article?cmd=listForUploaderAndAdmin&index=${index}">${index}</a>
									</c:if>
								</li>
							</c:forEach>

							<li>
								<c:if
									test="${pager.pagectrl.currentindex==pager.pagectrl.pagecount}"
									var="fp">
									<a style="disabled: true">下一页</a>
								</c:if>
								<c:if test="${!fp}">
									<a
										href="<%=basePath%>sys/article/article?cmd=listForUploaderAndAdmin&index=${pager.pagectrl.currentindex+1}">下一页</a>
								</c:if>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
